import yaml


class YamlHandler:
    def __init__(self, file):
        self.file = file

    def read(self, encoding='utf-8'):
        f = open(self.file, encoding=encoding)
        # TODO: f.read()或者f都可以作为参数
        data = yaml.load(f, yaml.FullLoader)
        f.close()
        return data


# 读取所有yaml配置项
yaml_data = YamlHandler().read()
